package dd.prog2.musterExercises.ws12set07_tanks;

import java.util.Iterator;

/**
 * Contains a test method for the tank system implementation.
 * 
 * @author Ruediger Lunde
 * 
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		CompositeTank tank1 = new CompositeTank();
		tank1.add(new CuboidTank(1, 2, 1));
		tank1.add(new CylindricalTank(1, 2));
		tank1.add(new SphericalTank(1));
		CompositeTank tank2 = tank1.clone(); // deep copy

		Iterator<Tank> itr = tank2.iterator();
		itr.next();
		itr.remove(); // remove first basic tank from copy!

		System.out.println(tank1); // original contains 3 basic tanks.
		for (Tank part : tank1)
			System.out.println("   " + part);

		System.out.println("\n" + tank2); // copy contains 2 basic tanks.
		for (Tank part : tank2)
			System.out.println("   " + part);
	}
}
